<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		request.setAttribute("name", "zhangsan");
		session.setAttribute("name", "lisi");
		application.setAttribute("name", "wangwu");
		
		//pageContext.setAttribute("age", 12);
		pageContext.setAttribute("age", 123, PageContext.SESSION_SCOPE);
		//等价于
		session.setAttribute("age", 123);
	%>
	<%=request.getAttribute("name") %><br/>
	<%=session.getAttribute("name") %><br/>
	<%=application.getAttribute("name") %><br/>
	<hr/>
	<%=pageContext.getAttribute("age") %><br/>
	<%=pageContext.getAttribute("age", PageContext.SESSION_SCOPE) %><br/>
	<%=session.getAttribute("age") %><br/>
	<%=pageContext.findAttribute("age") %>
</body>
</html>